<template>
	<view class="head">
		<input v-model="searchInfo" @input="handleSearch" placeholder="搜索好友" />
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	const props = defineProps(['token']);


	const searchInfo = ref('')
	const handleSearch = async () => {
		console.log(props.token);
		const friendList = await uni.request({
			url: 'http://192.168.1.200:8080/user/userInfo',
			method: 'POST',
			header: {
				'Content-Type': 'application/json',
				'token': props.token,
			},
			data: {
				name: searchInfo.value,
			}
		})

		console.log(friendList);
	}
</script>

<style lang="scss">
	.head {
		height: 80rpx;
		overflow: hidden;

		input {
			background-color: lightblue;
			height: 40rpx;
			width: 60%;
			border-radius: 20rpx;
			margin: 20rpx auto;
			text-align: center;

			input::placeholder {
				color: white;
			}
		}
	}
</style>